home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Graphics Samples / Test Cubics (cubic to quad) ƒ / TestCubics.h < prev    next >
Encoding:
Text File  |  1996-04-11  |  3.3 KB  |  142 lines  |  [TEXT/MPS ]

  1. /**\
  2. |**| =====================================================================
  3. |**|
  4. |**|    FILENAME
  5. |**|        TestCubics.h
  6. |**|    
  7. |**|    DESCRIPTION
  8. |**|        This is the include file for the TestCubics Quickdraw GX
  9. |**|        sample program.
  10. |**|    
  11. |**|    COPYRIGHT
  12. |**|        ©1992-1996 Copyright Apple Computer, Inc.
  13. |**|        All rights reserved.
  14. |**|    
  15. |**|    Change History:
  16. |**|
  17. |**|        4/96    cnn        Replaced obsolete <values.h> with <float.h> and
  18. |**|                    <limits.h>. Included <SANE.h>. Updated the header
  19. |**|                    filename, description, and copyright. Updated
  20. |**|                    #includes to support Universal Interfaces 2.1 and
  21. |**|                    changed GX Library names.
  22. |**|
  23. |**| =====================================================================
  24. \**/
  25.  
  26. //#ifdef MakeDumpFile
  27.  
  28. #include <Controls.h>
  29. #include <CursorCtl.h>
  30. #include <Desk.h>
  31. #include <Dialogs.h>
  32. #include <Events.h>
  33. #include <FixMath.h>
  34. #include <float.h>
  35. #include <Fonts.h>
  36. #include <limits.h>
  37. #include <Math.h>
  38. #include <Memory.h>
  39. #include <Menus.h>
  40. #include <OSUtils.h>
  41. #include <Packages.h>
  42. #include <Palettes.h>
  43. #include <Picker.h>
  44. #include <Quickdraw.h>
  45. #include <Resources.h>
  46. #include <SANE.h>
  47. #include <Scrap.h>
  48. #include <SegLoad.h>
  49. #include <stdio.h>
  50. #include <TextEdit.h>
  51. #include <ToolUtils.h>
  52. #include <Windows.h>
  53.  
  54. #include "TestCubicsRef.h"
  55.  
  56. #define debugging
  57.  
  58. #include <GXGraphics.h>
  59. #include <GXEnvironment.h>
  60. #include <GraphicsLibraries.h>
  61. #include <GXErrors.h>
  62. #include <GraphicsStateLibrary.h>
  63.  
  64.  
  65. #define kSysEnvVers    1
  66. #define kOsEvent    app4Evt
  67. #define kSusResMes    1
  68. #define kResMask    1
  69. #define kMouseMoved    0xFA
  70. #define extremeNeg    -32768
  71. #define extremePos     32767 - 1
  72. #define kMinDocSize        64
  73.  
  74. #define kGrowBHeight    17
  75. #define kGrowBWidth        17
  76. #define kCloseEnough    3
  77. #define kThick            2
  78.  
  79. enum {    kCursInit,
  80.         kCursArrow,
  81.         kCursCross,
  82.         kCursHand,
  83.         kCursWatch
  84. };
  85.  
  86.  
  87. #define TopLeft(aRect)    (* (Point *) &(aRect).top)
  88. #define BotRight(aRect)    (* (Point *) &(aRect).bottom)
  89. #define HiWrd(aLong)    (((aLong) >> 16) & 0xFFFF)
  90. #define LoWrd(aLong)    ((aLong) & 0xFFFF)
  91.  
  92. extern void _DataInit();
  93.  
  94. typedef struct {
  95.     CWindowRecord    docWindow;
  96.     gxViewPort    vp;
  97.     long        count;
  98.     gxPoint       **data;
  99.  
  100. } DocumentRecord, *DocumentPeek;
  101.  
  102.  
  103. /* prototypes for TestClip.c */
  104.  
  105. void EventLoop(void);
  106. void DoEvent(EventRecord *event, short *cursFlag);
  107. void AdjustCursor(EventRecord *event, short *cursFlag);
  108. void DoGrowWindow(WindowPtr window, EventRecord *event);
  109. void DoZoomWindow(WindowPtr window, short part);
  110. void ResizeWindow(WindowPtr window);
  111. void DoUpdate(WindowPtr    window);
  112. void DoContentClick(WindowPtr window,EventRecord *event,short *cursFlag);
  113. short DoCubicDrag( gxPoint *, Point, DocumentPeek );
  114.  
  115. void SetWorkRect(WindowPtr window, Rect    *pinRect, Rect *limitRect);
  116. void Initialize( void );
  117. void DrawControlHandle( gxPoint * );
  118. void DrawCubicNumbers( DocumentPeek );
  119. void DrawCubicControl( gxShape );
  120. void DrawWindow(WindowPtr window);
  121. void DrawCurves( gxPoint **data );
  122. void DrawMyGrow(WindowPtr window);
  123. void AdjustMenus( void );
  124. void DoMenuCommand(long menuResult);
  125. void DoCloseWindow(WindowPtr window);
  126. Boolean IsAppWindow(WindowPtr window);
  127. Boolean IsDAWindow(WindowPtr window);
  128.  
  129. void ExitApplication( WindowPtr );
  130. long CountQuadratics( const cubic * );
  131.  
  132. gxShape NewCubic(  const cubic * );
  133. gxShape NewCubic2( const cubic *, const long );
  134.  
  135. /******
  136. #pragma dump ":Objects:DumpFile"
  137.  
  138. #else
  139.  
  140. #pragma load ":Objects:DumpFile"
  141.  
  142. #endif***/